package com.ruoyi.zsyh.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zsyh.mapper.ZsyhServiceOrderSettleRepairMapper;
import com.ruoyi.zsyh.domain.ZsyhServiceOrderSettleRepair;
import com.ruoyi.zsyh.service.IZsyhServiceOrderSettleRepairService;
import com.ruoyi.common.core.text.Convert;

/**
 * 师傅结算记录Service业务层处理
 * 
 * @author yuexl
 * @date 2022-09-15
 */
@Service
public class ZsyhServiceOrderSettleRepairServiceImpl implements IZsyhServiceOrderSettleRepairService 
{
    @Autowired
    private ZsyhServiceOrderSettleRepairMapper zsyhServiceOrderSettleRepairMapper;

    /**
     * 查询师傅结算记录
     * 
     * @param id 师傅结算记录ID
     * @return 师傅结算记录
     */
    @Override
    public ZsyhServiceOrderSettleRepair selectZsyhServiceOrderSettleRepairById(String id)
    {
        return zsyhServiceOrderSettleRepairMapper.selectZsyhServiceOrderSettleRepairById(id);
    }

    /**
     * 查询师傅结算记录列表
     * 
     * @param zsyhServiceOrderSettleRepair 师傅结算记录
     * @return 师傅结算记录
     */
    @Override
    public List<ZsyhServiceOrderSettleRepair> selectZsyhServiceOrderSettleRepairList(ZsyhServiceOrderSettleRepair zsyhServiceOrderSettleRepair)
    {
        return zsyhServiceOrderSettleRepairMapper.selectZsyhServiceOrderSettleRepairList(zsyhServiceOrderSettleRepair);
    }

    /**
     * 新增师傅结算记录
     * 
     * @param zsyhServiceOrderSettleRepair 师傅结算记录
     * @return 结果
     */
    @Override
    public int insertZsyhServiceOrderSettleRepair(ZsyhServiceOrderSettleRepair zsyhServiceOrderSettleRepair)
    {
        zsyhServiceOrderSettleRepair.setId(IdWorker.getId());
        zsyhServiceOrderSettleRepair.setCreateTime(DateUtils.getNowDate());
        return zsyhServiceOrderSettleRepairMapper.insertZsyhServiceOrderSettleRepair(zsyhServiceOrderSettleRepair);
    }

    /**
     * 修改师傅结算记录
     * 
     * @param zsyhServiceOrderSettleRepair 师傅结算记录
     * @return 结果
     */
    @Override
    public int updateZsyhServiceOrderSettleRepair(ZsyhServiceOrderSettleRepair zsyhServiceOrderSettleRepair)
    {
        return zsyhServiceOrderSettleRepairMapper.updateZsyhServiceOrderSettleRepair(zsyhServiceOrderSettleRepair);
    }

    /**
     * 删除师傅结算记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteZsyhServiceOrderSettleRepairByIds(String ids)
    {
        return zsyhServiceOrderSettleRepairMapper.deleteZsyhServiceOrderSettleRepairByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除师傅结算记录信息
     * 
     * @param id 师傅结算记录ID
     * @return 结果
     */
    @Override
    public int deleteZsyhServiceOrderSettleRepairById(String id)
    {
        return zsyhServiceOrderSettleRepairMapper.deleteZsyhServiceOrderSettleRepairById(id);
    }
}
